package com.arpa.wms.domain.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

import java.util.HashMap;
import java.util.Map;


/**
 * @description 任务类型：RECEIVE收货、PUTAWAY上架、PICKING拣货、CHECK复核、INVENTORY盘点、MOVE移位
 *
 * @author leo
 * @date 2020/10/09
 **/
public enum WmsTaskTypeEnum implements IEnum<String> {
    /**
     * 收货单类型
     */
    RECEIVE("RECEIVE","收货"),
    PUTAWAY("PUTAWAY","上架"),
    PICKING("PICKING","拣货"),
    CHECK("CHECK","复核"),
    INVENTORY("INVENTORY","盘点"),
    MOVE("MOVE","移位");

    /**
     * 值
     */
    private final String value;

    /**
     * 描述
     */
    private final String desc;

    WmsTaskTypeEnum(final String value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    private static final Map<String, WmsTaskTypeEnum> MAP = new HashMap();

    static {
        WmsTaskTypeEnum[] values = values();
        int length = values.length;
        for(int i = 0; i < length; i++){
            WmsTaskTypeEnum value1 = values[i];
            MAP.put(value1.getValue(),value1);
        }
    }

    public static WmsTaskTypeEnum getEnumByValue(String value){

        return MAP.get(value);
    }
    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String toString(){
        return this.desc;
    }

    public String getDesc() {
        return this.desc;
    }
}
